<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>{:session('cp.cpsysname')}--服务商管理平台</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
    <meta name="description" content="{:config('webconfig.description');}">
    <meta name="keywords" content="{:config('webconfig.keywords');}">
    <meta name="author" content="runoob">
    <link rel="stylesheet" href="__STATIC_URL__/static/bootstrap/3.3.7/css/bootstrap.min.css">
    <link rel="stylesheet" type="text/css" href="__STATIC_URL__/static/css/index.css"/>
    <script src="__STATIC_URL__/static/jquery/2.2.1/jquery.min.js"></script>
    <script src="__STATIC_URL__/static/bootstrap/3.3.7/js/bootstrap.min.js"></script>
    <script src="__STATIC_URL__/static/layer/layer.js" type="text/javascript" charset="utf-8"></script>
</head>
<body>

{include file='public/header'/}
<!------------------导航-------------------------->
<section>
    {include file='public/left'/}
    <!--------------------------主要内容区域------------------------------------->
    <div class="content">
        <div class="page-heading mgl15 mgr15">
            <ul class="breadcrumb">
                <li>当前位置是&nbsp;:&nbsp;</li>
                <li><a href="#">微信管理</a></li>
                <li class="active" style="color: #02b87f;"> 域名管理</li>
            </ul>
        </div>
        <div class="panel panel-default mgl15 mgr15">
            <div class="panel-body">

                <div id="myTabContent" class="tab-content">
                    <div class="tab-pane active in" id="home">

                        <div class="panel panel-default">
                            <div class="panel-heading">
                                <h3 class="panel-title">设置小程序服务器域名</h3>
                            </div>
                            <div class="panel-body">
                                <form class="form-horizontal" name="form" id="frm1" style="max-width: 900px;">
                                    <input type="hidden" name="setup" value="requesturl">
                                    <div class="form-group">
                                        <label class="control-label col-sm-3">request合法域名：</label>
                                        <div class="col-sm-9">
                                            <input type="text" class="form-control" placeholder="" name="requestdomain"
                                                   value="{$info['requestdomain']}" >
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="control-label col-sm-3">socket合法域名：</label>
                                        <div class="col-sm-9">
                                            <input type="text" class="form-control" placeholder="" name="wsrequestdomain"
                                                   value="{$info['wsrequestdomain']}" >
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="control-label col-sm-3">上传文件合法域名：</label>
                                        <div class="col-sm-9">
                                            <input type="text" class="form-control" placeholder="" name="uploaddomain"
                                                   value="{$info['uploaddomain']}" >
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="control-label col-sm-3">下载文件合法域名：</label>
                                        <div class="col-sm-9">
                                            <input type="text" class="form-control" placeholder="" name="downloaddomain"
                                                   value="{$info['downloaddomain']}" >
                                        </div>
                                    </div>
                                    <div class="form-group text-center">
                                        <span class="btn btn-default" id="sethy">设置</span>
                                    </div>
                                </form>

                            </div>
                        </div>
                        <div class="panel panel-default">
                            <div class="panel-heading">
                                <h3 class="panel-title">设置小程序业务域名</h3>
                            </div>
                            <div class="panel-body">
                                <form class="form-horizontal" name="form" id="frm2" style="max-width: 900px;">
                                    <input type="hidden" name="setup" value="viewurl">
                                    <div class="form-group">
                                        <label class="control-label col-sm-3">业务域名：</label>
                                        <div class="col-sm-9">
                                            <input type="text" class="form-control" placeholder="" name="webviewdomain"
                                                   value="{$info['webviewdomain']}" >
                                        </div>
                                    </div>
                                    <div class="form-group text-center">
                                        <span class="btn btn-default" id="setyw">设置</span>
                                    </div>
                                </form>

                            </div>
                        </div>
                        <div class="panel panel-default">
                            <div class="panel-heading">
                                <h3 class="panel-title">设置模板消息</h3>
                            </div>
                            <div class="panel-body">
                                <form class="form-horizontal" name="form" id="frm3" style="max-width: 900px;">
                                    <input type="hidden" name="setup" value="tpl">
                                    <div class="form-group">
                                        <label class="control-label col-sm-3">模板消息编号：</label>
                                        <div class="col-sm-9">
                                            <input type="text" class="form-control" placeholder="" name="webviewdomain"
                                                   value="{$info['xcx_yy_tpl']}">
                                        </div>
                                    </div>
                                    <div class="form-group text-center">
                                        <span class="btn btn-default" id="setaddtpl">设置</span>
                                    </div>
                                </form>

                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        {include file='public/footer'/}
    </div>
</section>

</body>

<script>


    $(function () {
        $("#sethy").click(function () {
            layer.confirm('是否设置？', {
                btn: ['确认', '取消'] //按钮
            }, function () {
                $.ajax({
                    url: "{:url('xcxsysset/set_xcx_domain')}",
                    type: "post",
                    data: $('#frm1').serialize(),
                    success: function (data) {
                        if (data.code == "0") {

                            layer.msg("设置成功", {icon: 1});
                            return false;
                        } else {
                            layer.alert("操作失败  "+data.code+"   "+data.message, {icon: 7});
                        }
                    }
                })
            }, function () {
                layer.msg('您已取消!', {
                    time: 500, //20s后自动关闭
                });
            });

        })
        $("#setaddtpl").click(function () {

            layer.confirm('是否设置？', {
                btn: ['确认', '取消'] //按钮
            }, function () {
                $.ajax({
                    url: "{:url('xcxsysset/set_xcx_domain')}",
                    type: "post",
                    data:{},
                    success: function (data) {
                        if (data.code == "0") {

                            layer.msg("设置成功", {icon: 1});
                            setTimeout("window.location.href=window.location.href",2000);
                            return false;
                        } else {
                            layer.alert("操作失败  "+data.code+"   "+data.message, {icon: 7});
                        }
                    }
                })
            }, function () {
                layer.msg('您已取消!', {
                    time: 500, //20s后自动关闭
                });
            });

        })
       
        $("#setyw").click(function () {
            layer.confirm('是否设置？', {
                btn: ['确认', '取消'] //按钮
            }, function () {
                $.ajax({
                    url: "{:url('xcxsysset/set_xcx_domain')}",
                    type: "post",
                    data: $('#frm2').serialize(),
                    success: function (data) {
                        // console.log(data);
                        if (data.code == "0") {

                            layer.msg("设置成功", {icon: 1});
                            return false;
                        } else {
                            layer.alert("操作失败  "+data.code+"   "+data.message, {icon: 7});
                        }
                    }
                })
            }, function () {
                layer.msg('您已取消!', {
                    time: 500, //20s后自动关闭
                });
            });

        })
    })
</script>
</html>


